package ferp.core.state;

import ferp.core.game.Game;
import ferp.core.game.Input;
import ferp.core.game.Settings;
import ferp.core.mode.Dropping;
import ferp.core.mode.Mode;
import ferp.core.player.Profile;

/**
 * User: olegs
 * Date: 1/12/14 11:02 PM
 */
public class MisereConfirm2 extends State
{
  @Override
  public int process(Game.Listener listener, Profile profile, Game g, Settings settings, Input input) throws Game.Error
  {
    if (input.misere)
      g.set(Mode.misere);
    else
      Dropping.Undo.execute(g);

    // save the current state
    save(profile);

    return Result.SCHEDULE;
  }
}
